package org.smartboot.socket.common;

import java.io.Serializable;
import java.util.Date;
/**
 * @author laoliu
 * @since 1.0
 */
public class ChatMessage implements Serializable {
    private String from;
    private String to;
    private String msg;
    private Date d=new Date();

    /**
     * 聊天信息的状态
     */
    public static enum TO{
        /**
         * all
         */
        _ALL,_NONE,_LOGIN;
    }
    public ChatMessage(){

    }
    public ChatMessage(  String to, String msg) {
        this.to = to;
        this.msg = msg;
    }
    public ChatMessage(String from, String to, String msg) {
        this.from = from;
        this.to = to;
        this.msg = msg;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public String getTo() {
        return to;
    }

    public void setTo(String to) {
        this.to = to;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Date getD() {
        return d;
    }

    public void setD(Date d) {
        this.d = d;
    }

    @Override
    public String toString() {
        return "ChatMessage{" +
                "from='" + from + '\'' +
                ", to='" + to + '\'' +
                ", msg='" + msg + '\'' +
                ", d=" + d +
                '}';
    }
}
